﻿using Architecture.Domain.Service;
using Architeture.Domain.DTO;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler
{
    public class UserGetTreeCommandHandler : IRequestHandler<UserGetTreeCommand, List<mentumn>>
    {
        private readonly IUserService userService;

        public UserGetTreeCommandHandler(IUserService userService)
        {
            this.userService = userService;
        }

        public async Task<List<mentumn>> Handle(UserGetTreeCommand request, CancellationToken cancellationToken)
        {
            return await userService.GetUserTree(request.id);
        }
    }
}
